#ifndef LOGMACROS_H
#define LOGMACROS_H

#if defined(ENABLE_LOG_MACROS) && defined(ENABLE_FILE_LOG)    //< Put "DEFINES += ENABLE_LOG" in the .pro/.pri file to enable Logging.
    #include <QDebug>
    #define QDEBUG_TAG(tag, exp) qDebug() << "(" << tag << ")" << \
                                            __FILE__ << ":" << __LINE__ << \
                                            " - " << exp

    #define QDEBUG(exp)         qDebug() << __FILE__ << ":" << __LINE__ << \
                                        " - " << exp

    #define QCRITICAL_TAG(tag, exp) qCritical() << "(" << tag << ")" << \
                                                " - " << exp

    #define QCRITICAL(exp) qCritical() << __FILE__ << ":" << __LINE__ << \
                                        " - " << exp

    #define QWARNING_TAG(tag, exp) qWarning() << "(" << tag << ")" << \
                                        __FILE__ << ":" << __LINE__ << \
                                        " - " << exp

    #define QWARNING(exp) qWarning() << __FILE__ << ":" << __LINE__ << \
                                        " - " << exp

    // common debugs:
    #define QDEBUG_ENTER_FN() qDebug() << "( enter )" << \
                                        __FILE__ << ":" << __LINE__ << \
                                        " - " << __FUNCTION__
    #define QDEBUG_EXIT_FN() qDebug() << "( exit )" << \
                                        __FILE__ << ":" << __LINE__  << \
                                        " - " << __FUNCTION__
#else
    #define QDEBUG_TAG(tag, exp)
    #define QDEBUG(exp)

    #define QCRITICAL_TAG(tag, exp)
    #define QCRITICAL(exp)

    #define QWARNING_TAG(tag, exp)
    #define QWARNING(exp)

    // common debugs:
    #define QDEBUG_ENTER_FN()
    #define QDEBUG_EXIT_FN()
#endif // ENABLE_LOG && ENABLE_FILE_LOG

#if defined(ENABLE_LOG) && defined(ENABLE_FILE_LOG) && defined(ENABLE_VERBOSE)
    #define QVERBOSE_TAG(tag, exp) qDebug() << "( verbose )" << \
                                        "(" << tag << ")" << \
                                        __FILE__ << ":" << __LINE__ << \
                                        " - " << exp
    #define QVERBOSE(exp) qDebug() << "( verbose )" << \
                                        __FILE__ << ":" << __LINE__ << \
                                        " - " << exp
#else
    #define QVERBOSE_TAG(tag, exp)
    #define QVERBOSE(exp)
#endif // ENABLE_LOG && ENABLE_FILE_LOG && ENABLE_VERBOSE

#endif // LOGMACROS_H
